#@layout()

#define script()
<script src="/static/components/tinymce/tinymce.min.js"></script>
<script>

    $("#sync").on("click",function () {
        $.ajax({ url: "/admin/permission/syncPermissions",  success: function(result){
           alert(result.msg);
        }});
    })



    $("#chooseimage").on("click",function () {
        layer.open({
            type: 2,
            title: '选择图片',
            anim: 2,
            shadeClose: true,
            shade: 0.5,
            area: ['80%', '70%'],
            content: '/admin/menu/menu',
            end: function () {
                if ('' != data.url && null != data.url) {
                    callback(data.url, {alt: data.alt});
                }
            }
        });
    })


</script>
#end

#define content()
<div class="content-wrapper">

    <section class="content-header">
        <h1>
            权限管理
            <small>Permission manager</small>
        </h1>
        <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li><a href="#"> 用户</a></li>
            <li class="active">权限管理</li>
        </ol>
    </section>


    <section class="content">

        <div class="row">
            <div class="col-xs-12">
                <div class="box box-primary">

                    <div class="box-header  ">
                        <div class="actionPanel">
                            <div class="col-xs-12">
                                <div class="btn-group">
                                    <button type="button" class="btn btn-default active">全部</button>
                                    <button type="button" class="btn btn-default">菜单</button>
                                    <button type="button" class="btn btn-default">URL</button>
                                    <button type="button" class="btn btn-default">页面块</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body waterfall-container">

                        #for(x : permissionGroup)
                        <div class="waterfall-item">
                            <div class="box box-dashboard">
                                <div class="box-header with-border">
                                    <h3 class="box-title">#(x.key ??)</h3>
                                </div>
                                <!-- /.box-header -->
                                <div class="box-body no-padding">
                                    <table class="table table-striped">
                                        <tbody>
                                        <tr>
                                            <th style="width: 10px">#</th>
                                            <th>ActionKey</th>
                                            <th>描述</th>
                                            <th style="width: 80px">类型</th>
                                        </tr>
                                        #for(permission : x.value)
                                        <tr>
                                            <td>#(permission.id ??)</td>
                                            <td>#(permission.action_key ??)</td>
                                            <td>#(permission.text ??)</td>
                                            <td>#(permission.typeText ??)</td>
                                        </tr>
                                        #end
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        #end

                    </div>
                </div>
            </div>

        </div>

    </section>


</div>
#end
